<?php get_header(); ?>
<!-- category begin-->
<main role="main" class="">
    <section id="breadcrumbs" class="breadcrumbs">
        <?php $category = get_queried_object(); ?>
        <div class="container py-3">
            <div class="py-lg-5 d-flex flex-column justify-content-center align-items-center">
                <h1><a href="<?php echo get_term_link($category->term_id); ?>" rel="category"><?php echo $category->name; ?></a></h1>
                <ol>
                    <li><a href="<?php home_url('/'); ?>">home page</a></li>
                    <li><a href="<?php echo get_term_link($category->term_id); ?>"><?php echo $category->name; ?></a></li>
                </ol>
            </div>
        </div>
    </section>
    <div class="container mt-5">
        <div class="row">
            <?php if (have_posts()) :  ?>
                <?php while (have_posts()) : the_post(); ?>
                    <div class="col-md-12">
                        <div class="news-img">
                            <div class="row">
                                <div class="col-md-2 mb-3 mb-lg-0">
                                    <div class="entry-img effect-imghover">
                                        <a href="<?php the_permalink(); ?>">
                                            <?php the_post_thumbnail('thumbnail', ['class' => 'img-fluid']); ?>
                                        </a>
                                    </div>
                                </div>
                                <div class="col-md-10">
                                    <h5><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h5>
                                    <p class="text-muted m-0">
                                        <i class="fa fa-folder-open-o text-customer"></i>
                                        <a href="<?php the_permalink(); ?>" rel="category">Read More</a>
                                        <i class="fa fa-clock-o text-customer"></i> <?php the_time('Y-m-d H:i:s'); ?>
                                        <i class="fa fa-eye text-customer"></i> <?php echo get_views(get_the_ID());?>
                                    </p>
                                    <p class="text-muted mt-2 m-0"><?php the_excerpt(); ?></p>
                                </div>
                            </div>
                        </div>
                    </div>
            <?php endwhile;
            endif; ?>
        </div>
        <!-- row -->

        <div class="row my-5">
            <div class="col-md-12">
                <?php // 设置分页参数
                $args = array(
                    'format'    => '?paged=%#%', // 指定分页格式
                    'type'      => 'list', // 指定为列表类型
                    'prev_next' => false,
                    'aria_current' => 'active',
                );
                // 获取分页链接
                echo $paginates = paginate_links($args);
                ?>
            </div>
        </div>
    </div>
</main>
<!-- category end-->
<?php get_footer(); ?>